<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>教师查询</title>
    <link rel="stylesheet" href="/styles/student.css">
    <script src="/js/delete.js"></script>
</head>
<body>
    <header>
        <div>
            <div>
                <i>👨🏫</i>
                <h1>教育查询系统 - 教师查询</h1>
            </div>
        </div>
    </header>
    <form action="/toaddteacher" method="GET">
        <button type="submit" class="add-button">添加新的教师</button>
    </form>
    <table>
        <tr>
            <th>TeacherID</th>
            <th>Name</th>
            <th>操作</th>
        </tr>
        {{range .Teachers}}
        <tr>
            <td>{{.TeacherID}}</td>
            <td>{{.Name}}</td>
            <td>
                <button class="delete-button" data-id="{{.TeacherID}}" data-type="teacher">删除</button>
            </td>
        </tr>
        {{end}}
    </table>
    <div>
        {{if gt .Page 1}}
        <a href="/teacher?page={{sub .Page 1}}">上一页</a>
        {{end}}
        <a href="/teacher?page={{add .Page 1}}">下一页</a>
    </div>
    <form action="/index" method="GET">
        <button type="submit" class="add-button">返回主页</button>
    </form>
</body>
</html>